<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>获得年份 </title>
    <script type="text/javascript">
        var mydate = new Date();
        var myyear = mydate.getFullYear();
        document.write("今年是:" + myyear + "<br>");
        var weekday = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
        var mynum = mydate.getDay();
        document.write("今天是：" + weekday[mynum] + "<br>");
        document.write("当前时间：" + mydate + "<br>");

        mydate.setTime(mydate.getTime() + 2 * 60 * 60 * 1000);
        document.write("推迟二小时时间：" + mydate);
    </script>
    </script>
    <
    /head>
    < body >
    < /body>
    < /html>